<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<title>添加面料</title>
</head>
<body>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="add_Fabric_Form">
       <div class="row cl">
	    	<label class="form-label col-1"><span class="c-red"></span>多图上传：</label>
	    	<div class="formControls col-10">
	    		<input type="hidden" id="returnImgArray" value="">
	    		<div class="uploader-list-container">
			    	<div class="queueList">
				    	<div id="dndArea" class="placeholder">
							<div id="filePicker-2"></div>
							<p>或将照片拖到这里，单次最多可选300张</p>
						</div>
					</div>
					<div class="statusBar" style="display:none;">
						<div class="progress"> 
							<span class="text">0%</span> 
							<span class="percentage"></span> 
						</div>
						<div class="info"></div>
						<div class="btns">
							<div id="filePicker2"></div>
							<div class="uploadBtn">开始上传</div>
						</div>
					</div>
				</div>
			</div>
	    </div>
       <div class="row cl">
       	 <div class="col-9 col-offset-3">
	         <a class="btn btn-primary save"  onclick="operationdataValidate()">上传完成</a>
	         <a class="btn btn-primary" onclick="closethis()">取消</a>
         </div>
       </div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/uploadImg.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/jqthumb/jqthumb.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/tableBtnGroup.js"></script>
<script type="text/javascript">
$(function(){
	var serviceUrl='${pageContext.request.contextPath }/upload/upload';
	uploadImg(serviceUrl);
});

function operationdataValidate(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	var imgList=$('#returnImgArray').val();
	var arr=new Array();
	arr=imgList.split('|');//注split可以用字符或字符串分割
	var pDivHtml=parent.$('#${domId}').html();
	var imgHtml="";
	for(var i=0;i<arr.length;i++)
	{
		imgHtml+='<img class="jqthumb" alt="" src="${pageContext.request.contextPath }/upload/'+arr[i]+'">'
	}
	//parent.$('#${domId}').val($('#returnImgArray').val());
	parent.$('[name="${domId}"]').val($('#returnImgArray').val());
	parent.$('#${domId}').html(imgHtml+pDivHtml);
	parent.$('#aaId').trigger('click');
	
    parent.layer.close(index);
}

function closethis(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
   	parent.layer.close(index);
}
</script>
</body>
</html>